/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.fsiebert.polytech.db.mediatheque.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Florent
 */
@Embeddable
public class ExemplaireReservationPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "NumeroArticle", nullable = false)
    private int numeroArticle;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idReservation", nullable = false)
    private int idReservation;

    public ExemplaireReservationPK() {
    }

    public ExemplaireReservationPK(int numeroArticle, int idReservation) {
        this.numeroArticle = numeroArticle;
        this.idReservation = idReservation;
    }

    public int getNumeroArticle() {
        return numeroArticle;
    }

    public void setNumeroArticle(int numeroArticle) {
        this.numeroArticle = numeroArticle;
    }

    public int getIdReservation() {
        return idReservation;
    }

    public void setIdReservation(int idReservation) {
        this.idReservation = idReservation;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) numeroArticle;
        hash += (int) idReservation;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ExemplaireReservationPK)) {
            return false;
        }
        ExemplaireReservationPK other = (ExemplaireReservationPK) object;
        if (this.numeroArticle != other.numeroArticle) {
            return false;
        }
        if (this.idReservation != other.idReservation) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "eu.fsiebert.polytech.db.mediatheque.entity.ExemplaireReservationPK[ numeroArticle=" + numeroArticle + ", idReservation=" + idReservation + " ]";
    }
    
}
